
import edu.wpi.first.smartdashboard.gui.StaticWidget;
import edu.wpi.first.smartdashboard.gui.Widget;
import edu.wpi.first.smartdashboard.properties.Property;
import edu.wpi.first.smartdashboard.robot.Robot;
import edu.wpi.first.smartdashboard.types.DataType;
import edu.wpi.first.wpilibj.networking.NetworkAdditionListener;
import edu.wpi.first.wpilibj.networking.NetworkListener;
import edu.wpi.first.wpilibj.networking.NetworkTable;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */

/**
 *
 * @author Franklin
 */
public class FireButton extends Widget {

    public JButton Fire1000;
    public JButton Fire1300;
    public JButton Fire1500;
    public JButton Fire1800;
    public JButton Fire2000;
    public JButton Fire2200;
    public JButton Fire2400;
    public JButton Fire2800;
    public static final DataType[] TYPES = {DataType.INTEGER};
    private boolean value;

    @Override
    public void init() {
        Fire1500 = new JButton("1500");
        Fire1500.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 1500);
            }
        });
        
        Fire1000 = new JButton("1000");
        Fire1000.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 1500);
            }
        });
    
        Fire1300 = new JButton("1300");
        Fire1300.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 1300);
            }
        });
        
        Fire1800 = new JButton("1800");
        Fire1800.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 1800);
            }
        });
        
        Fire2000 = new JButton("2000");
        Fire2000.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 2000);
            }
        });

        Fire2200 = new JButton("2200");
        Fire2200.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 2200);
            }
        });

        Fire2400 = new JButton("2400");
        Fire2400.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 2400);
            }
        });
        Fire2800 = new JButton("2800");
        Fire2800.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                NetworkTable table = Robot.getTable();
                table.putInt("Shooting", 2800);
            }
        });

        
        
        
        
        
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new GridLayout(0, 1));
        buttonPanel.add(Fire1000);
        buttonPanel.add(Fire1300);
         buttonPanel.add(Fire1500);
         buttonPanel.add(Fire1800);
         buttonPanel.add(Fire2000);
         buttonPanel.add(Fire2200);
         buttonPanel.add(Fire2400);
         buttonPanel.add(Fire2800);
         setLayout(new BorderLayout());
        add(buttonPanel, BorderLayout.SOUTH);
    }

    @Override
    public void propertyChanged(Property prprt) {
        //   throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setValue(Object value) {
    }
}
